﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NetTopologySuite.Features;
namespace Observer
{
    public class FeatureSubject:ISubject
    {


        private List<IObserver> _observers = new List<IObserver>();

        public IFeature mFeature { get; set; }
        public ChangeStatus mChangeStatus { get; set; }

        public void attach(IObserver observer)
        {
            _observers.Add(observer);
        }

        public void detach(IObserver observer)
        {
            _observers.Remove(observer);
        }

        public void notify()
        {
            foreach (var observer in _observers)
            {
                observer.update(mFeature, mChangeStatus);
            }
        }
    }

}
